<?php
include __DIR__."/Solution.php";

/**
 * Created by PhpStorm.
 * User: Sage
 * Date: 2019/4/11
 * Time: 11:06
 */
class SolutionTest extends  \PHPUnit\Framework\TestCase {


    /**
     * @param mixed ...$params
     * @dataProvider dataProvider
     */
    function testSolution(...$params){
        $answer=array_pop($params);
        $this->assertEquals($answer,(new Solution)->subarraySum(...$params));
    }

    function dataProvider(){
        return [
            [[1,2,3],3,2],
            [[1,1,1],2,2],
            [[1,1,1,1],2,3],
            [[1,2,3,4,3,2,1],3,4],
            [[100,1,2,100,2,100,1,1,1,100,2],3,2],
            [[1,2,3,4,5,6,7,1,23,21,3,1,2,1,1,1,1,1,12,2,3,2,3,2,2],12,4],
            [[28,54,7,-70,22,65,-6],100,1]
        ];
    }
}



